package com.shuyun.xxx.guava.practice;

import org.junit.Test;

/**
 * Created by goodb on 2017/5/21.
 */
public class GCReferenceTest {
    private Object instance = null;
    private static final int size = 1024 * 1024;
    private byte[] bytes = new byte[2 * size];
    public void setInstance(Object instance){
        this.instance = instance;
    }
    public static int getSize(){
        return size;
    }
    @Test
    public void run(){
        GCReferenceTest a = new GCReferenceTest();
        GCReferenceTest b = new GCReferenceTest();
        a.setInstance(b);
        b.setInstance(a);

        a = null;
        b = null;
        System.gc();
    }
}
